package vip.mtdp.asset.api.dto;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Description
 * @Author Evans.wang
 * @since 2023/10/29 10:05
 **/
@Data
public class AccountDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    /**
     * 账户类型：集中（CA）/专户(SA)
     */
    private String type;

    private Long vaultId;
    private String chain;
    /**
     * 账户编号，专户=地址数据，集中=自定义数据
     */
    private String no;
    private String name;
    private Integer state;
    private Integer level;
    /**
     * 账户余额标签：user=用户地址，miners_fee=矿工费地址，position=头寸地址，outside=外部地址，cold=冷端地址
     */
    private String label;

    /**
     * 余额列表
     */
    private List<BalanceDTO> balanceDTOList;

    @Data
    public static class BalanceDTO implements Serializable{
        private static final long serialVersionUID = 1L;

        private Long id;

        private Long vaultId;

        private Long accountId;

        private String no;

        private String chain;

        private String coin;

        private String tokenId;
        /**
         * balance=dr-cr-frozen
         */
        private BigDecimal balance = BigDecimal.ZERO;
        private BigDecimal balanceDr = BigDecimal.ZERO;
        private BigDecimal balanceCr = BigDecimal.ZERO;
        private BigDecimal frozenBalance = BigDecimal.ZERO;
        /**
         * 是否允许为负，0=否，1=是
         */
        private Integer allowNegative;
        /**
         * 0=禁用，1=启用
         */
        private Integer state;
    }

}
